﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraBars;

namespace HRM.DICTIONARY.UI
{
    public partial class xfrmWorkingProcess : DevExpress.XtraEditors.XtraForm
    {
        private DateTime m_BeginDate;
        private string m_EmployeeCode = "";
        private DateTime m_EndDate;
        private bool m_Filter = false;

        public xfrmWorkingProcess()
        {
            InitializeComponent();
        }

        private void xfrmWorkingProcess_Load(object sender, EventArgs e)
        {
            this.bbiFilter.EditValue = "<Tất Cả>";
            try
            {
                this.bbiBeginDate.EditValue = new DateTime(DateTime.Now.Year - 1, DateTime.Now.Month, DateTime.Now.Day);
            }
            catch
            {
                this.bbiBeginDate.EditValue = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
            }
            this.bbiEndDate.EditValue = DateTime.Now;
            //if (this.xucAssignment == null)
            //{
            //    this.xucAssignment = new HRM.CORE.Process.xucAssignment(this.m_EmployeeCode);
            //    this.xucAssignment.Dock = DockStyle.Fill;
            //    this.tabAssignment.Controls.Add(this.xucAssignment);
            //}
        }

        private void SetFilterDate(bool value)
        {
            if (value)
            {
                this.bbiBeginDate.Visibility = BarItemVisibility.Always;
                this.bbiEndDate.Visibility = BarItemVisibility.Always;
            }
            else
            {
                this.bbiBeginDate.Visibility = BarItemVisibility.Never;
                this.bbiEndDate.Visibility = BarItemVisibility.Never;
            }
        }

        private void repFilter_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.SetFilterDate(this.m_Filter = !this.m_Filter);
        }

        private void repEmployee_EditValueChanged(object sender, EventArgs e)
        {

        }

        private void repEmployee_EditValueChanging(object sender, DevExpress.XtraEditors.Controls.ChangingEventArgs e)
        {

        }

        
    }
}